'use strict';
const MANIFEST = 'flutter-app-manifest';
const TEMP = 'flutter-temp-cache';
const CACHE_NAME = 'flutter-app-cache';
const RESOURCES = {
  "assets/AssetManifest.json": "77db3ee43fab1d7b0232ab39129a2934",
"assets/assets/2.0x/icon_daohang_back.png": "bf68b56ef6abd7a682d12e3a79114b46",
"assets/assets/2.0x/icon_daohang_fenxiang.png": "ea71cd5e61bbe71d12c1d5c585770ede",
"assets/assets/2.0x/icon_denglu_close.png": "740f15862a1737630b89f529d90f3989",
"assets/assets/2.0x/icon_denglu_xianshi_n.png": "e255e92811191f33d33f0a8757e8f74f",
"assets/assets/2.0x/icon_denglu_xianshi_y.png": "46f085f32971d1f32857f9c93730979d",
"assets/assets/2.0x/icon_goumai_no_xiayizhang.png": "cd5dadf1766dab221329fc5f5c863343",
"assets/assets/2.0x/icon_goumai_yes_xiayizhang.png": "7f47f4ee72b2f4e2c04944c10dc4aae9",
"assets/assets/2.0x/icon_me_guanyu.png": "d74a5c85ac10712fde9fbfff7977210f",
"assets/assets/2.0x/icon_me_more.png": "34f850da4a2dae026cd9ffdcebced344",
"assets/assets/2.0x/icon_me_name.png": "da4d6d913bcf851352863c2711328d7e",
"assets/assets/2.0x/icon_me_shezhi.png": "5f5af8d633c16d05dba047cdd1065849",
"assets/assets/2.0x/icon_me_yijianfankui.png": "f467c67634075901ff0eebd441d1a208",
"assets/assets/2.0x/icon_shouye_more.png": "be56bc52176a6d323d6e43937bf1c6a0",
"assets/assets/2.0x/icon_shujia_n.png": "bf7a64682ebb18ca5037a26fa34f714f",
"assets/assets/2.0x/icon_shujia_y.png": "dc93eecc69c2650cd02bf067fc41d26c",
"assets/assets/2.0x/icon_tab_me_n.png": "3fa28901d5f81ce302c29994b7a859a1",
"assets/assets/2.0x/icon_tab_me_y.png": "6d39442c1baeabc40bd063b23314735b",
"assets/assets/2.0x/icon_tab_shouye_n.png": "48af66fac733ff8f63bb2674231d1cc2",
"assets/assets/2.0x/icon_tab_shouye_y.png": "2f314900b4bc153082aa27d8e01de0f7",
"assets/assets/2.0x/icon_tab_shujia_n.png": "e0fc89ca8a43fd8d89dc68c1b1ca9ce4",
"assets/assets/2.0x/icon_tab_shujia_y.png": "24cc70cc860c88c594934d9bdc141fdc",
"assets/assets/2.0x/icon_xiangqing_daoxu.png": "afbdb5538b6fe0422085e35961f793a2",
"assets/assets/2.0x/icon_xiangqing_zhengxu.png": "1324c516dec6377f1657f09fac394b41",
"assets/assets/2.0x/icon_zhengwen_mulu.png": "2950cc05f258bcd964f1ff839d71c269",
"assets/assets/2.0x/icon_zhengwen_shang.png": "d6cd06e4067bacb42d10c5becf5ee6b5",
"assets/assets/2.0x/icon_zhengwen_shujia_n.png": "c00fbccd93604044d84c42e2ba720a1a",
"assets/assets/2.0x/icon_zhengwen_shujia_y.png": "c40e9a474cffb604b47fe39f272e68ac",
"assets/assets/2.0x/icon_zhengwen_xia.png": "204cddf87e5b7b259ca98ccbf7b34280",
"assets/assets/2.0x/img_denglu_beijing.png": "9bd191ee1db8f5706d0d7a97d0aaabb6",
"assets/assets/2.0x/img_denglu_logo.png": "fd3a5345c20d07fa62f13e7183ecbddd",
"assets/assets/2.0x/img_denglu_pingguo.png": "7e43f16fd45faf1e3533c1dc23945267",
"assets/assets/2.0x/img_denglu_shouji.png": "88e31c4d4438c9bd75fdb9a91ab18897",
"assets/assets/2.0x/img_morentouxiang.png": "14744fe0b0f6c0f4d922277b31b17dea",
"assets/assets/2.0x/img_shouye_logo.png": "c3a6282dd3ad3d87f6a0fa577de7f883",
"assets/assets/2.0x/img_splash_logo.png": "fc64bb62a0e1bfb0b129fd59f75c9ced",
"assets/assets/2.0x/img_xiangqing_biaoshi.png": "4dbc238e45451f6e20ff31f4fb8ee75e",
"assets/assets/2.0x/reader_battery.png": "3b4caceff5c00da3fdb122d3f7c70a0d",
"assets/assets/3.0x/icon_daohang_back.png": "9e99d84382b068910ff238e112eb944f",
"assets/assets/3.0x/icon_daohang_fenxiang.png": "cdaf7069456a16107e3960d18aadaa1e",
"assets/assets/3.0x/icon_denglu_close.png": "50e0735682a94c3bd594500fe4d7daef",
"assets/assets/3.0x/icon_denglu_xianshi_n.png": "8376468d81eb835ba0525c49ed061143",
"assets/assets/3.0x/icon_denglu_xianshi_y.png": "88bb0c2f4df61cf3fd19d4282ff90d36",
"assets/assets/3.0x/icon_goumai_no_xiayizhang.png": "aa0b5afa193a37dab7acbb87f60ed44d",
"assets/assets/3.0x/icon_goumai_yes_xiayizhang.png": "ef809a99a9df4f76257370061d7cf757",
"assets/assets/3.0x/icon_me_guanyu.png": "ff9a7eb2e1301295338fce50482598c4",
"assets/assets/3.0x/icon_me_more.png": "55ecec61cab508c2312c0f0af2d1e702",
"assets/assets/3.0x/icon_me_name.png": "8e43c3326fc9c353b78ef2bb18d34a41",
"assets/assets/3.0x/icon_me_shezhi.png": "a0ebef1db19b3ad15b135a9a231b4bad",
"assets/assets/3.0x/icon_me_yijianfankui.png": "667bfa4cc15cf1eade5eb6ba07d466ed",
"assets/assets/3.0x/icon_shouye_more.png": "68068412350c427a198084eab4ea9498",
"assets/assets/3.0x/icon_shujia_n.png": "92d7a88943c0f809094a7d22a5bb4e02",
"assets/assets/3.0x/icon_shujia_y.png": "9658dff1b89d65d21a53eaef80360db2",
"assets/assets/3.0x/icon_tab_me_n.png": "4bb9efd10640dffe5a052a133b661d8e",
"assets/assets/3.0x/icon_tab_me_y.png": "582caa94e3a297d59286e0e438ddd52b",
"assets/assets/3.0x/icon_tab_shouye_n.png": "db723b08df7be9f6b497bb64f002fad3",
"assets/assets/3.0x/icon_tab_shouye_y.png": "5b872c864dd238e806c012146f4144ad",
"assets/assets/3.0x/icon_tab_shujia_n.png": "559e882b4a7406a940858c514d1af324",
"assets/assets/3.0x/icon_tab_shujia_y.png": "88a97edc6666fd619537266ba7b4b128",
"assets/assets/3.0x/icon_xiangqing_daoxu.png": "d080af087589277f32d3b5302dcbcaa0",
"assets/assets/3.0x/icon_xiangqing_zhengxu.png": "0d964d992b3ac952a94ad6dc840b4aa2",
"assets/assets/3.0x/icon_zhengwen_mulu.png": "29c3d5165ae7b35320a2a6a8c0bd7b22",
"assets/assets/3.0x/icon_zhengwen_shang.png": "2c6964916f74e209c67fdb5b13c5175d",
"assets/assets/3.0x/icon_zhengwen_shujia_n.png": "2a4e4f31274036f6ff13b1468eff9120",
"assets/assets/3.0x/icon_zhengwen_shujia_y.png": "0832c262450f679a329af249d54125be",
"assets/assets/3.0x/icon_zhengwen_xia.png": "8e522ffd44a8bd31e98c44c354fd3869",
"assets/assets/3.0x/img_denglu_beijing.png": "ce58c7c196a6e3f2aea65c3f45fcec92",
"assets/assets/3.0x/img_denglu_logo.png": "68c4126b83f2e277ed2103602a968941",
"assets/assets/3.0x/img_denglu_pingguo.png": "537c668c647e1ef21b1c8fb3b349e8ad",
"assets/assets/3.0x/img_denglu_shouji.png": "17798b44dd612b72e0f6849fc8195278",
"assets/assets/3.0x/img_morentouxiang.png": "5538c29df83349cd54c68c68cdd5c213",
"assets/assets/3.0x/img_shouye_logo.png": "d392420da16c170945bc17185a137f1c",
"assets/assets/3.0x/img_splash_logo.png": "7842e0749d070ba3fcbd6c95649e1a64",
"assets/assets/3.0x/img_xiangqing_biaoshi.png": "b9bc6d4d46155a52acc6cf6bfd675bd3",
"assets/assets/icon_daohang_back.png": "5980d1670aee52acc90410aee310ed74",
"assets/assets/icon_daohang_fenxiang.png": "d38f0e3c2de4824358dc70c1d156de47",
"assets/assets/icon_denglu_close.png": "27990d737f946b16735be0664f9822fc",
"assets/assets/icon_denglu_xianshi_n.png": "bfd76480121b3d7b4da0d062fef48d1d",
"assets/assets/icon_denglu_xianshi_y.png": "9f73f75e63c465e3cd50d1c30096a9d3",
"assets/assets/icon_detail_setting_offline.png": "802b332f05e31fc61363356573bf113f",
"assets/assets/icon_goumai_no_xiayizhang.png": "cd5dadf1766dab221329fc5f5c863343",
"assets/assets/icon_goumai_yes_xiayizhang.png": "7f47f4ee72b2f4e2c04944c10dc4aae9",
"assets/assets/icon_lianzai_fufei.png": "140da1edeee8c15b4386d72baf95e811",
"assets/assets/icon_lianzai_yifufei.png": "8ce34303fb3a986aefefdff9d55337b6",
"assets/assets/icon_logo.png": "7e984aee767a984de2b1c77b05d9c49b",
"assets/assets/icon_me_guanyu.png": "f145286e03038cae7ad555bf339f0398",
"assets/assets/icon_me_more.png": "4f3a5cabbb89dc5305ea80416b950616",
"assets/assets/icon_me_name.png": "6d39b590c0c57cd0f8ef1de3f8489c66",
"assets/assets/icon_me_shezhi.png": "b03511caba4f9e79e8ea7af1480847a4",
"assets/assets/icon_me_yijianfankui.png": "79089544f705e95514107ef92b013850",
"assets/assets/icon_shouye_more.png": "97c27b660aa9660f37dbd3159330d823",
"assets/assets/icon_shujia_n.png": "07192de1864b271b8ab7aa1e4d21ddc4",
"assets/assets/icon_shujia_y.png": "3aa135c68388ebc02d932cfb852fbe82",
"assets/assets/icon_tab_me_n.png": "310cdaa2c49401bd412cbae403970602",
"assets/assets/icon_tab_me_y.png": "5e0412bd3853ac8589c597c49d81ddda",
"assets/assets/icon_tab_shouye_n.png": "ec76b9142621500cfc171766d294c391",
"assets/assets/icon_tab_shouye_y.png": "35a74b1573c4c38fa0e53d35dcb2a9f8",
"assets/assets/icon_tab_shujia_n.png": "e099e441be224c0c5070c01b50966b78",
"assets/assets/icon_tab_shujia_y.png": "21e8dafa0ddc488a10a2980c5e63c3a1",
"assets/assets/icon_xiangqing_daoxu.png": "40c1439b38cca043f53ae8c7351ee22f",
"assets/assets/icon_xiangqing_zhengxu.png": "9a7e552d3df11c5137033b7c87362c29",
"assets/assets/icon_zhengwen_mulu.png": "82ea9b1239777a80542eccd56bec18b3",
"assets/assets/icon_zhengwen_shang.png": "de68dd50f9c0dc4b2ba49c94835d3177",
"assets/assets/icon_zhengwen_shujia_n.png": "7be2e4e8ecca9a95daa491df73f78de5",
"assets/assets/icon_zhengwen_shujia_y.png": "4323d0fcbf4bdda601d2bc54025f7f41",
"assets/assets/icon_zhengwen_xia.png": "93866c10d97789980b95cf6bbb411501",
"assets/assets/img_denglu_beijing.png": "a97db29cf0d31d6f618702e60c33ba96",
"assets/assets/img_denglu_logo.png": "b71ef5225d491d6b8978b143ba84b84e",
"assets/assets/img_denglu_pingguo.png": "242700cb6dde98c8529b3cc44c3e5cc7",
"assets/assets/img_denglu_shouji.png": "a08d7c99542a97b6c946327b7a3f61ea",
"assets/assets/img_morentouxiang.png": "8c83b4444b3acb4ea4defbc872f07aa5",
"assets/assets/img_shouye_logo.png": "85be9e88297c2e7438dc46f07166b8ab",
"assets/assets/img_splash_logo.png": "7ee9596eefd0a1d28c84a98522ac1d0c",
"assets/assets/img_xiangqing_biaoshi.png": "9e7fbdaf884e03a270acc6ab1e44a998",
"assets/assets/reader_battery.png": "b7f87b5bb8e0755440a12fd22ca98429",
"assets/FontManifest.json": "7b2a36307916a9721811788013e65289",
"assets/fonts/MaterialIcons-Regular.otf": "4e6447691c9509f7acdbf8a931a85ca1",
"assets/NOTICES": "8700f7ecf95a8f31a3fcfe4895ec1e1c",
"assets/packages/flutter_inappwebview/t_rex_runner/t-rex.css": "5a8d0222407e388155d7d1395a75d5b9",
"assets/packages/flutter_inappwebview/t_rex_runner/t-rex.html": "16911fcc170c8af1c5457940bd0bf055",
"favicon.png": "5dcef449791fa27946b3d35ad8803796",
"icons/Icon-192.png": "ac9a721a12bbc803b44f645561ecb1e1",
"icons/Icon-512.png": "96e752610906ba2a93c65f8abe1645f1",
"index.html": "c78108b3b77864190680af51e30f2950",
"/": "c78108b3b77864190680af51e30f2950",
"main.dart.js": "c12c0b6504ebd5822efe6cd667e28d0b",
"manifest.json": "a686257d003afc263ba382d70de4be34",
"splash/img/light-background.png": "26065e2f2e2aca65250ecebcec05f124",
"splash/style.css": "dc29b2e7c0aefd84ea25de492ad4d7e7",
"version.json": "9b57c57039d32d0c1adbafc80a62b795"
};

// The application shell files that are downloaded before a service worker can
// start.
const CORE = [
  "/",
"main.dart.js",
"index.html",
"assets/NOTICES",
"assets/AssetManifest.json",
"assets/FontManifest.json"];
// During install, the TEMP cache is populated with the application shell files.
self.addEventListener("install", (event) => {
  self.skipWaiting();
  return event.waitUntil(
    caches.open(TEMP).then((cache) => {
      return cache.addAll(
        CORE.map((value) => new Request(value, {'cache': 'reload'})));
    })
  );
});

// During activate, the cache is populated with the temp files downloaded in
// install. If this service worker is upgrading from one with a saved
// MANIFEST, then use this to retain unchanged resource files.
self.addEventListener("activate", function(event) {
  return event.waitUntil(async function() {
    try {
      var contentCache = await caches.open(CACHE_NAME);
      var tempCache = await caches.open(TEMP);
      var manifestCache = await caches.open(MANIFEST);
      var manifest = await manifestCache.match('manifest');
      // When there is no prior manifest, clear the entire cache.
      if (!manifest) {
        await caches.delete(CACHE_NAME);
        contentCache = await caches.open(CACHE_NAME);
        for (var request of await tempCache.keys()) {
          var response = await tempCache.match(request);
          await contentCache.put(request, response);
        }
        await caches.delete(TEMP);
        // Save the manifest to make future upgrades efficient.
        await manifestCache.put('manifest', new Response(JSON.stringify(RESOURCES)));
        return;
      }
      var oldManifest = await manifest.json();
      var origin = self.location.origin;
      for (var request of await contentCache.keys()) {
        var key = request.url.substring(origin.length + 1);
        if (key == "") {
          key = "/";
        }
        // If a resource from the old manifest is not in the new cache, or if
        // the MD5 sum has changed, delete it. Otherwise the resource is left
        // in the cache and can be reused by the new service worker.
        if (!RESOURCES[key] || RESOURCES[key] != oldManifest[key]) {
          await contentCache.delete(request);
        }
      }
      // Populate the cache with the app shell TEMP files, potentially overwriting
      // cache files preserved above.
      for (var request of await tempCache.keys()) {
        var response = await tempCache.match(request);
        await contentCache.put(request, response);
      }
      await caches.delete(TEMP);
      // Save the manifest to make future upgrades efficient.
      await manifestCache.put('manifest', new Response(JSON.stringify(RESOURCES)));
      return;
    } catch (err) {
      // On an unhandled exception the state of the cache cannot be guaranteed.
      console.error('Failed to upgrade service worker: ' + err);
      await caches.delete(CACHE_NAME);
      await caches.delete(TEMP);
      await caches.delete(MANIFEST);
    }
  }());
});

// The fetch handler redirects requests for RESOURCE files to the service
// worker cache.
self.addEventListener("fetch", (event) => {
  if (event.request.method !== 'GET') {
    return;
  }
  var origin = self.location.origin;
  var key = event.request.url.substring(origin.length + 1);
  // Redirect URLs to the index.html
  if (key.indexOf('?v=') != -1) {
    key = key.split('?v=')[0];
  }
  if (event.request.url == origin || event.request.url.startsWith(origin + '/#') || key == '') {
    key = '/';
  }
  // If the URL is not the RESOURCE list then return to signal that the
  // browser should take over.
  if (!RESOURCES[key]) {
    return;
  }
  // If the URL is the index.html, perform an online-first request.
  if (key == '/') {
    return onlineFirst(event);
  }
  event.respondWith(caches.open(CACHE_NAME)
    .then((cache) =>  {
      return cache.match(event.request).then((response) => {
        // Either respond with the cached resource, or perform a fetch and
        // lazily populate the cache.
        return response || fetch(event.request).then((response) => {
          cache.put(event.request, response.clone());
          return response;
        });
      })
    })
  );
});

self.addEventListener('message', (event) => {
  // SkipWaiting can be used to immediately activate a waiting service worker.
  // This will also require a page refresh triggered by the main worker.
  if (event.data === 'skipWaiting') {
    self.skipWaiting();
    return;
  }
  if (event.data === 'downloadOffline') {
    downloadOffline();
    return;
  }
});

// Download offline will check the RESOURCES for all files not in the cache
// and populate them.
async function downloadOffline() {
  var resources = [];
  var contentCache = await caches.open(CACHE_NAME);
  var currentContent = {};
  for (var request of await contentCache.keys()) {
    var key = request.url.substring(origin.length + 1);
    if (key == "") {
      key = "/";
    }
    currentContent[key] = true;
  }
  for (var resourceKey of Object.keys(RESOURCES)) {
    if (!currentContent[resourceKey]) {
      resources.push(resourceKey);
    }
  }
  return contentCache.addAll(resources);
}

// Attempt to download the resource online before falling back to
// the offline cache.
function onlineFirst(event) {
  return event.respondWith(
    fetch(event.request).then((response) => {
      return caches.open(CACHE_NAME).then((cache) => {
        cache.put(event.request, response.clone());
        return response;
      });
    }).catch((error) => {
      return caches.open(CACHE_NAME).then((cache) => {
        return cache.match(event.request).then((response) => {
          if (response != null) {
            return response;
          }
          throw error;
        });
      });
    })
  );
}
